package com.hxzy.shop.member.controller;

import com.github.pagehelper.PageInfo;
import com.hxzy.shop.member.dto.label.req.LabelListsReq;
import com.hxzy.shop.member.dto.label.resp.LabelListsResp;
import com.hxzy.shop.member.service.LabelService;
import com.hxzy.shop.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @author admin
 * @Desc
 * @Date 2023/8/8
 */
@RestController
@Api(tags = "-会员-会员标签")
@RequestMapping("/member")
public class MemberLabelController {

    @Autowired
    private LabelService labelService;

    /**
     * 会员标签列表
     *
     * @param req 标签列表请求体
     * @return {@code PageInfo<LabelListsResp>}
     */
    @PostMapping("/labelLists")
    @ApiOperation(value = "会员标签列表")
    public Result<PageInfo<LabelListsResp>> labelLists(@RequestBody @Validated LabelListsReq req){
        PageInfo<LabelListsResp> pageInfo =this.labelService.labelLists(req);
        return Result.success(pageInfo);
    }
}
